Scientific Linux 6
Sponsored Link

Pacemaker - Cluster Configuration for DRBD
2011/06/19
 
Configure Clustering for DRBD.
This example shows to configure on the environment like follows.
(1)  www01.srv.world  ( eth0 [192.168.1.60],  eth1 [10.0.0.60] )
(2)  www02.srv.world  ( eth0 [192.168.1.61],  eth1 [10.0.0.61] )
This example uses eth0 for inter-connection and uses eth1 for service provider.
[1] Configure Clustering. Set it on a Host.
[root@www01 ~]#
crm configure

crm(live)configure#
primitive drbd0 ocf:linbit:drbd \

>
params drbd_resource="r0" drbdconf="/etc/drbd.conf" \

>
op start timeout="240s" \

>
op monitor interval="20s" timeout="20s" \

>
op stop timeout="100s"

crm(live)configure#
ms ms_drbd0 drbd0 \

>
meta master-max="1" \

>
master-node-max="1" \

>
clone-max="2" \

>
clone-node-max="1" \

>
notify="true"

crm(live)configure#
primitive filesystem ocf:heartbeat:Filesystem \

>
params device="/dev/drbd0" \

>
fstype="ext4" \

>
directory="/mnt/drbd0" \

>
op start timeout="60s" \

>
op monitor interval="20s" timeout="40s" \

>
op stop timeout="60s"

crm(live)configure#
colocation fs_on_drbd inf: filesystem ms_drbd0:Master

crm(live)configure#
order fs_after_drbd inf: ms_drbd0:promote filesystem:start

crm(live)configure#
show
# confirm settings

node www01.srv.world
node www02.srv.world
primitive drbd0 ocf:linbit:drbd \
        params drbd_resource="r0" drbdconf="/etc/drbd.conf" \
        op start interval="0" timeout="240s" \
        op monitor interval="20s" timeout="20s" \
        op stop interval="0" timeout="100s"
primitive filesystem ocf:heartbeat:Filesystem \
        params device="/dev/drbd0" fstype="ext4" directory="/mnt/drbd0" \
        op start interval="0" timeout="60s" \
        op monitor interval="20s" timeout="40s" \
        op stop interval="0" timeout="60s"
ms ms_drbd0 drbd0 \
        meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"
colocation fs_on_drbd inf: filesystem ms_drbd0:Master
order fs_after_drbd inf: ms_drbd0:promote filesystem:start
property $id="cib-bootstrap-options" \
        dc-version="1.1.2-f059ec7ced7a86f18e5490b67ebf4a0b963bccfe" \
        cluster-infrastructure="openais" \
        expected-quorum-votes="2" \
        no-quorum-policy="ignore" \
        stonith-enabled="false"
rsc_defaults $id="rsc-options" \
        resource-stickiness="INFINITY" \
        migration-threshold="1"
crm(live)configure#
commit
# enable settings

crm(live)configure#
exit

bye
[2] Make sure status with crm_mon.
[root@www01 ~]#
crm_mon

============
Last updated: Sun Jun 19 21:03:25 2011
Stack: openais
Current DC: www01.srv.world - partition with quorum
Version: 1.1.2-f059ec7ced7a86f18e5490b67ebf4a0b963bccfe
2 Nodes configured, 2 expected votes
2 Resources configured.
============

Online: [ www01.srv.world www02.srv.world ]

 Master/Slave Set: ms_drbd0
     Masters: [ www01.srv.world ]
     Slaves: [ www02.srv.world ]
filesystem      (ocf::heartbeat:Filesystem):    Started www01.srv.world
[3] Reboot active server and Make sure active node switches normally.
[root@www02 ~]#
crm_mon

============
Last updated: Sun Jun 19 21:04:53 2011
Stack: openais
Current DC: www02.srv.world - partition WITHOUT quorum
Version: 1.1.2-f059ec7ced7a86f18e5490b67ebf4a0b963bccfe
2 Nodes configured, 2 expected votes
2 Resources configured.
============

Online: [ www02.srv.world ]
OFFLINE: [ www01.srv.world ]

 Master/Slave Set: ms_drbd0
     Masters: [ www02.srv.world ]
     Stopped: [ drbd0:0 ]
filesystem      (ocf::heartbeat:Filesystem):    Started www02.srv.world
 
Tweet